luci-mod-network: dynamically find mode and bssid positions
authorPaul Donald <[email protected]>
Mon, 3 Nov 2025 21:34:08 +0000 (22:34 +0100)
committerPaul Donald <[email protected]>
Mon, 3 Nov 2025 21:38:53 +0000 (22:38 +0100)
Dynamically find the mode and bssid position assignments in case their position
should change later.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index 1bd192b3253700dd6c0050ffcc70886c9ea20af3..6d107dae11b6b9679f2ab373bf13cd43baea9f4d 100644 (file)
@@ -1117,8 +1117,8 @@ return view.extend({
 
                                let encr;
                                if (hwtype == 'mac80211') {
-                                       const mode = ss.children[0];
-                                       const bssid = ss.children[5];
+                                       const mode = ss.children.find(obj => obj.option === 'mode');
+                                       const bssid = ss.children.find(obj => obj.option === 'bssid');
 
                                        if (have_mesh) mode.value('mesh', '802.11s');
                                        mode.value('ahdemo', _('Pseudo Ad-Hoc (ahdemo)'));